home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / bbs / random.zip / RANDOM.DOC < prev    next >
Text File  |  1994-01-06  |  4KB  |  97 lines

  1.  
  2.  
  3.                                -=Random=-
  4.                               Version 1.1ß
  5.                            (c) Copyright 1994
  6.                               Jaben Cargman
  7.                            BBS: (602) 282-3134
  8.                             FidoNet: 1:114/304
  9.  
  10.  Introduction:
  11.  
  12.         A while back (before I could program) I used to love to
  13.         create batch files and even thought about designing some
  14.         program with them.  But there was a lot of limitations, I had
  15.         to have 5 different program to accomplish one task. I didn't
  16.         mind that much, batch files were all I knew.  One day
  17.         I decided to create a artificial life form program
  18.         out of batch files.  I worked on it for about 2 days and then
  19.         gave up. I needed a program that I could give a number and
  20.         it would give me a random DOS errorlevel in return.  Since
  21.         I didn't have access to BBS's yet and wasn't that
  22.         knowledgeable about how to obtain programs, I stopped the
  23.         'project' and got on with my other projects.
  24.         Well I finally started to learn C++.  Now that I can actually
  25.         program, I decided to create that program I had wanted for over
  26.         a year.  This is really my first programming attempt and I'm
  27.         quite pleased with it.  I decided to release it to the BBS
  28.         community because as a SysOp (which I am), I found a lot of
  29.         potential uses for it, which I will get to later...
  30.         For now, I will explain how to use the RANDOM program.  I made it
  31.         very easy to use, one command line argument is all that's
  32.         necessary.
  33.  
  34.  Operation:
  35.  
  36.         First I will explain how Random works, you give it a number (1
  37.         to 255) and it will randomize it and return a DOS errorlevel of
  38.         the number it chooses.
  39.  
  40.         Example:
  41.  
  42.         RANDOM.EXE 100
  43.  
  44.         In the example above, RANDOM would pick a number between 1 and 100
  45.         and exit with that errorlevel.
  46.  
  47.         Here's how you could use it in a batch file to pick a Random
  48.         program to run:
  49.  
  50.         @ECHO OFF
  51.  
  52.         RANDOM 5
  53.         IF ERRORLEVEL 5 GOTO RUN5
  54.         IF ERRORLEVEL 4 GOTO RUN4
  55.         IF ERRORLEVEL 3 GOTO RUN3
  56.         IF ERRORLEVEL 2 GOTO RUN2
  57.         IF ERRORLEVEL 1 GOTO RUN1
  58.         IF ERRORLEVEL 0 GOTO ERROR
  59.  
  60.         :RUN5
  61.         CD\FUN
  62.         FUN.EXE
  63.  
  64.         Etc.....
  65.  
  66.  
  67.         Note that Random will not exit will an errorlevel zero, in less
  68.         you give an improper command line.
  69.  
  70.  Other Uses:
  71.  
  72.         Random has a number of other uses.  I have a menu program that
  73.         has a color file.  Well I have RANDOM pick a new color every time
  74.         it loads.  For SysOp's there's many different uses.  In a nightly
  75.         event batch file you could have RANDOM change the display files
  76.         (ie. Menus, Hello Screens), you could have a 'Random Door' on your
  77.         board.  The random door would pick a random door for the user to
  78.         play.  That way the users will play games that they have never
  79.         played before.  I have included a batch file (DOOR10.BAT) for a
  80.         WildCat BBS, to give an example how you can do this.  If you have
  81.         found a interesting use for it, please leave me a message.  You
  82.         can reach me the following ways:
  83.  
  84.         VideoGame Horizons Online
  85.         (602) 282-3134 1:114/304
  86.         WildNet, TeenNet, AzNet, and FidoNet
  87.           AzNet address: 66:145/1
  88.         FidoNet address: 1:114/304
  89.  
  90.         One last note, this program is distributed as FreeWare.
  91.         If you use it often, please leave me a message and let me know
  92.         that you like it.
  93.  
  94.                                 Signed,
  95.  
  96.                                 Jaben Cargman
  97.